import 'package:flutter/material.dart';
import 'package:kepu/widgets/textWithIcon.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

Widget guessButton({
  required Size size,
  required String text,
  required bool isCorrect,
  required BuildContext context,
  required Color buttonBgColor,
}) {
  return GestureDetector(
    onTap: () {
      isCorrect
          ? TDToast.showSuccess(
            "恭喜你,猜对了",
            context: context,
            direction: IconTextDirection.vertical,
            maxLines: 2,
          )
          : TDToast.showFail(
            "很遗憾,猜错了",
            context: context,
            direction: IconTextDirection.vertical,
            maxLines: 2,
          );
    },
    child: Container(
      height: 80,
      width: size.width * 0.45,
      decoration: BoxDecoration(
        color: buttonBgColor,
        borderRadius: BorderRadius.circular(20),
      ),
      child: Center(child: labelText(text, color: Colors.white)),
    ),
  );
}
